Version

Insert(Int32,Boolean,Object[],Boolean) Method

Adds a new row to the collection at the spcified location.
Syntax
'Declaration
 
Public Overloads Function Insert( _
   ByVal index As Integer, _
   ByVal raiseAddEvents As Boolean, _
   ByVal cellValues() As Object, _
   ByVal bypassEditState As Boolean _
) As UltraDataRow
public UltraDataRow Insert( 
   int index,
   bool raiseAddEvents,
   object[] cellValues,
   bool bypassEditState
)

Parameters

index
Location in the collection at which to add the new row to.
raiseAddEvents
Specifies whether to raise RowAdding and RowAdded events.
cellValues
Optional parameter. Specifies the cell values with which to initialize the new row. An exception is thrown if the array has more elements thant the number of columns or if a value cannot be converted to the data type of the corresponding column.
bypassEditState
If this parameter is specified as True then the added row will be put in Edit and AddNew states. When a row is in Edit state it can be cancelled by calling ((IEditableObject)row).CancelEdit. The end user can cancel such a row by hitting Escape key twice on the row (if the row were being displayed in an UltraGrid or DataGrid). Cancelling a row in edit state reverts the cell values to their original values (as they were when the BeginEdit was called). When a row in AddNew state is canceled, it's removed from the collection. Overloads of this method that do not take this parameter default it to True.

Return Value

Returns the new row that was added to the collection.
Remarks

Insert method creates a new row and adds it to the collection at the specified location. If raiseAddEvents argument is true, RowAdding and RowAdded are raised. If RowAdding event is canceled, no new row is added to the collection and this method returns null.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also